#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
  FILE* fp = fopen("file.txt", "w");
  if (fp == NULL){
    perror("fopen fail!\n");
    exit(-1);
  }
  char str[] = "hello world";
  int  count = 5;
  while (count--){
    fwrite(str, 1, 1, fp);
  }
  fclose(fp);
  return 0;
}
